package com.gitee.cnlongs.cnlongmq.server.test;

import java.util.List;

import com.gitee.cnlongs.cnlongmq.basic.entitiy.request.CnLongMessageQueue;
import com.gitee.cnlongs.cnlongmq.server.LongMqServer;

public class LongMqTest101 {

	public static void main(String[] args) {
		
		LongMqServer mqServer = new LongMqServer("configtest/longmqconfig1");
		while(true) {
//			System.out.println(mqServer.getExecuter().getLongMqConfig().getSequeueList().size() + "------" 
//					+ mqServer.getExecuter().getLongMqConfig().getCustomerSequeueList().size());
//			List<CnLongMessageQueue> customerSequeueList = mqServer.getExecuter().getLongMqConfig().getCustomerSequeueList();
//			for (CnLongMessageQueue queue : customerSequeueList) {
//				System.out.println("队列ip【"+queue.getLongMqIp()+
//						"】队列端口【"+queue.getLongMqPort()+"】队列状态【"+queue.getLongMqStatus()+"】");
//			}
			System.out.println("队长信息：" + mqServer.getExecuter().getLongMqConfig().getCaptainElectionSequeue()
					+ "；候补队长信息：" + mqServer.getExecuter().getLongMqConfig().getCaptainElectionMap().toString());
			try {
				Thread.sleep(3000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
		
	}
	
}
